﻿@model DTOs.InvoiceDTO
           
@using System.Configuration;

@{
    ViewBag.Title = "Processing";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Processing....</h2>


<div >

		<!-- item_number should get passed back -->
		<form id="Paypal" name="Paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
			
			<input type="hidden" name="cmd" value="_cart" />
			<input type="hidden" name="upload" value="1" />
			
			<!-- The following is for aggregated PayPal data instead of itemized -->
			
			<input type="hidden" name="item_name" value="Aggregated Items" />
			<input type="hidden" name="amount" value="@Model.Total.ToString("#.00") %>" />
			
			
			<!-- The following is for itemized PayPal data instead of the aggregated version -->
			@*<%=SelectedInvoice.PaypalItemList%>*@
			<input type="hidden" name="tax_cart" value="@Model.Taxes.ToString("#.00")%>" />
			
			<!-- STANDARD DATA -->
			<input type="hidden" name="business" value="@ConfigurationManager.AppSettings["paypalAccount"]" />
									
			<input type="hidden" name="invoice" value="@Model.InvoiceId.ToString()%>" />
			<input type="hidden" name="no_note" value="0" /> 
			<input type="hidden" name="currency_code" value="@Model.Currency" />
			<input type="hidden" name="lc" value="@Model.ShipToCountry %>" /> 
			<input type="hidden" name="return" value="@ConfigurationManager.AppSettings["websiteUrl"]/Payment/Receipt" />
			<input type="hidden" name="cancel_return" value="@ConfigurationManager.AppSettings["websiteUrl"]" />
			<input type="hidden" name="email" value="@ConfigurationManager.AppSettings["paypalAccount"]" /> 
			<input type="hidden" name="cn" value="How did you hear about us?" />
           <input type="submit" value="Submit Payment Info" />
		</form>
		@*<%=SelectedInvoice.ToString() %>*@
	</div>

